UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oj1tMbn2nH6hhUdfyTV2L0MN9MSwhXPCX5EVd2reJPk=' 
WHERE 
  key_id = '629f279d19bad54bb265580fc7a870e3b4782be21d6f83631acb3aa0f84d22f3' 
  AND (
    token = 'Oj1tMbn2nH6hhUdfyTV2L0MN9MSwhXPCX5EVd2reJPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029