UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MXsmZSngHIZGPY/Z6vb2vIrj2Sm6kdpNyxB3BOb78A8=' 
WHERE 
  key_id = '5b9353ba01a4e0e6072b02b1997dc39ba0295afe6d5ef8a72d76d1615dc178b7' 
  AND (
    token = 'MXsmZSngHIZGPY/Z6vb2vIrj2Sm6kdpNyxB3BOb78A8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039