UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd+sSG21Va8KfXLajFUC/5qw+QTm7feNp8kgXt19qlVg=' 
WHERE 
  key_id = 'e3473525fc912eb70f2bea0c6412464a11087ba728e986d7825e5eb6c20bc302' 
  AND (
    token = 'd+sSG21Va8KfXLajFUC/5qw+QTm7feNp8kgXt19qlVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034