UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YhFw+bNpL3P9ldl8HpO6r/tulFBsT0GwGcIpb9sFNB4=' 
WHERE 
  key_id = 'baac1c87867dda63007768f6a0f70fd077263b3f02b8c3a63a714db8e1537d3c' 
  AND (
    token = 'YhFw+bNpL3P9ldl8HpO6r/tulFBsT0GwGcIpb9sFNB4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017