UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PM/km7aMcsy47xyZlXogTiUZ/6jvk+5Z1giDY5opZTg=' 
WHERE 
  key_id = 'e547bf3937c9f380749f671ba1326e771b0d2ed71ef0e57193393056b9a4624d' 
  AND (
    token = 'PM/km7aMcsy47xyZlXogTiUZ/6jvk+5Z1giDY5opZTg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042